﻿package plugin.juezhan.handler
{
    import com.core.*;
    import flash.utils.*;
    import plugin.juezhan.model.*;
    import pluginfw.nio.*;
    import pluginfw.nio.imsg.*;

    public class JuezhanGroupHandler extends Object implements IGroupHandler
    {

        public function JuezhanGroupHandler()
        {
            return;
        }// end function

        public function dealSimpleMessage(param1:ISimpleMessage) : void
        {
            switch(param1.getCmd())
            {
                case CMDJueZhan.BOSS_REFRESH:
                {
                    ModelProxy.change("juezhan", "bossRefresh", param1.getParam());
                    break;
                }
                case CMDJueZhan.ELITE_REFRESH:
                {
                    ModelProxy.change("juezhan", "eliteRefresh", param1.getParam());
                    break;
                }
                case CMDJueZhan.TIAN_GUAN_PROGRESS:
                {
                    ModelProxy.change("juezhan", "tianguanProgress", param1.getParam());
                    ModelProxy.change("data", "baoshiTianguanProgress", param1.getParam());
                    break;
                }
                case CMDJueZhan.TGRankInit:
                {
                    ModelProxy.change("juezhan", "tgRankInit", param1.getParam());
                    break;
                }
                case CMDJueZhan.TGRankReward:
                {
                    ModelProxy.change("juezhan", "tgRankReward", param1.getParam());
                    break;
                }
                case CMDJueZhan.ShitRankInit:
                {
                    ModelProxy.change("taskinstance", "init", param1.getParam());
                    break;
                }
                case CMDJueZhan.CsRankInit:
                {
                    ModelProxy.change("csinstance", "showRank", param1.getParam());
                    break;
                }
                case CMDJueZhan.ResTGRankRewards:
                {
                    ModelProxy.change("juezhan", "restgrankrewards", param1.getParam());
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function dealBufferMessage(param1:IBufferMessage) : void
        {
            var _loc_2:Input = null;
            _loc_2 = new Input(null);
            var _loc_3:* = param1.getBody();
            _loc_3.position = 0;
            _loc_2.setBytes(_loc_3);
            var _loc_4:* = new Object();
            switch(param1.getCmd())
            {
                case CMDJueZhan.ResTGRewards:
                {
                    _loc_4.tgid = _loc_2.readVarInt(false);
                    ModelProxy.change("juezhan", "restgrewards", _loc_4.tgid);
                    break;
                }
                case CMDJueZhan.ResTGRankRewards:
                {
                    ModelProxy.change("juezhan", "restgrankrewards", _loc_4.tgid);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function dealProxyMessage(param1:IProxyMessage) : void
        {
            return;
        }// end function

    }
}
